/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2017
 */

package models.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import common.base.*;
import common.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import models.model.*;
import models.dao.*;
import models.service.*;
import models.vo.query.*;

/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


public class Commoditys extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Commoditys";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_NAME = "名称";
	public static final String ALIAS_TYPES = "类型";
	public static final String ALIAS_IMG = "图片地址";
	public static final String ALIAS_SIZE = "产品尺寸";
	public static final String ALIAS_BRAND = "产品品牌";
	public static final String ALIAS_VERSION = "产品型号";
	public static final String ALIAS_INTRODUCE = "产品描述";
	public static final String ALIAS_IS_SHOW = "是否显示  1-显示  2 - 隐藏";
	public static final String ALIAS_MAIN_SHOW = "是否在首页显示  1-显示  2 - 隐藏";
	
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	private java.lang.Integer id;
	@Length(max=255)
	private java.lang.String name;
	
	private java.lang.Integer types;
	@Length(max=255)
	private java.lang.String img;
	@Length(max=255)
	private java.lang.String size;

	/** 图片地址分解 */
	private java.lang.String[] imgs;
	
	@Length(max=255)
	private java.lang.String brand;
	@Length(max=255)
	private java.lang.String version;
	@Length(max=2147483647)
	private java.lang.String introduce;
	@Length(max=255)
	private java.lang.String isShow;
	
	@Length(max=255)
	private java.lang.String mainShow;
	
	
	
	
	
	//columns END

	public java.lang.String getMainShow() {
		return mainShow;
	}

	public void setMainShow(java.lang.String mainShow) {
		this.mainShow = mainShow;
	}

	
	public Commoditys(){
	}

	public Commoditys(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	public java.lang.String getName() {
		return this.name;
	}
	public void setTypes(java.lang.Integer value) {
		this.types = value;
	}
	
	public java.lang.Integer getTypes() {
		return this.types;
	}
	public void setImg(java.lang.String value) {
		this.img = value;
	}
	
	public java.lang.String getImg() {
		return this.img;
	}
	
	public java.lang.String[] getImgs() {
		if(null==img || "".equals(img)) {
			return null;
		}
		
		return img.split("\\*\\*\\*\\*");
	}
	
	
	public void setSize(java.lang.String value) {
		this.size = value;
	}
	
	public java.lang.String getSize() {
		return this.size;
	}
	public void setBrand(java.lang.String value) {
		this.brand = value;
	}
	
	public java.lang.String getBrand() {
		return this.brand;
	}
	public void setVersion(java.lang.String value) {
		this.version = value;
	}
	
	public java.lang.String getVersion() {
		return this.version;
	}
	public void setIntroduce(java.lang.String value) {
		this.introduce = value;
	}
	
	public java.lang.String getIntroduce() {
		return this.introduce;
	}
	public void setIsShow(java.lang.String value) {
		this.isShow = value;
	}
	
	public java.lang.String getIsShow() {
		return this.isShow;
	}
	
	private MltwoLevel mltwoLevel;
	
	public void setMltwoLevel(MltwoLevel mltwoLevel){
		this.mltwoLevel = mltwoLevel;
	}
	
	public MltwoLevel getMltwoLevel() {
		return mltwoLevel;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Name",getName())
			.append("Types",getTypes())
			.append("Img",getImg())
			.append("Size",getSize())
			.append("Brand",getBrand())
			.append("Version",getVersion())
			.append("Introduce",getIntroduce())
			.append("IsShow",getIsShow())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Commoditys == false) return false;
		if(this == obj) return true;
		Commoditys other = (Commoditys)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

